<template>
	<div>
		<el-dialog
			title="待分配用户"
			:visible.sync="dialogTableVisible"
			:close-on-click-modal="false"
		>
			<el-table
				:data="userData"
				border
				row-key="id"
				:header-cell-style="{ background: '#eef1f6', color: '#606266' }"
				height="300"
				@selection-change="removeHandleSelectionChange"
			>
				<el-table-column type="selection" width="55"></el-table-column>
				<el-table-column prop="userRealName" label="名称"></el-table-column>
				<el-table-column prop="userAccount" label="账号"></el-table-column>
			</el-table>
			<el-button type="primary" size="small" @click="saveClick">保存</el-button>
			<el-button size="small" @click="cancelClick">取消</el-button>
		</el-dialog>
	</div>
</template>

<script>
export default {
	props: {
		dialogTableVisible: {
			type: Boolean,
		},
		allocated: {
			type: Array,
			default: () => {
				return []
			},
		},
	},
	data() {
		return {
			userData: [
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
				{ userRealName: '测试1', userAccount: '123' },
			],
		}
	},
	methods: {
		// 确认
		saveClick() {
			this.$emit('addUser', false)
		},
		// 取消
		cancelClick() {
			this.$emit('addUser', false)
		},
		removeHandleSelectionChange(val) {
			console.log(val)
		},
	},
}
</script>

<style></style>
